using UnityEngine;
using System.Collections;

public class DestructionScript : MonoBehaviour 
{
	public AudioSource Fail;
	
	public static int lives = 3;
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(lives == 0)
		{
			Application.LoadLevel("GameOver");
		}
	}
	
	void OnCollisionEnter(Collision collision)
	{
		if(collision.rigidbody)
		{
			updateScore();
			audio.Play();
		}
    }
	
	void updateScore()
	{
		LevelGUI.score -= 50;
		lives--;
		BombDrop.multiplier ++;
	}
}
